import java.util.*;

public class Java001 {
    public static void main(String[] args) {
        ArrayList<String> arrlist= new ArrayList<>();
        Collections.addAll(arrlist, "张三,21", "李四,24", "丁真,26", "珍珠,27", "锐刻五,30");
        HashMap<String, Integer> map = new HashMap<String, Integer>();
        Set<Map.Entry<String, Integer>> entries = map.entrySet();


        for (int i=0;i<arrlist.size();i++){
            String s = arrlist.get(i);
                int j=s.indexOf(',');
                String name=s.substring(0,j);//不包括，
                Integer age =new Integer(s.substring(j+1));
                if(age>24){
                    map.put(name,age);
                }
        }

        for(Map.Entry<String,Integer> entry:entries){
            String name = entry.getKey();
            Integer age = entry.getValue();
            System.out.println("name: "+name+"  age:"+age);
        }
    }
}
